package com.hzjy.api.controller;

import java.util.List;

import com.hzjy.api.beans.HzjyAdvertising;
import com.hzjy.api.service.impl.HzjyAdvertisingServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.hzjy.common.core.controller.BaseController;
import com.hzjy.common.core.domain.AjaxResult;
import com.hzjy.common.core.page.TableDataInfo;

/**
 * 广告位Controller
 * 
 * @author hzjy
 * @date 2020-09-22
 */
@RestController
@RequestMapping("/api/advertising")
public class HzjyAdvertisingController extends BaseController
{
    @Autowired
    private HzjyAdvertisingServiceImpl hzjyAdvertisingService;

    /**
     * 查询广告位列表
     */
    @GetMapping("/list")
    public TableDataInfo list(HzjyAdvertising hzjyAdvertising)
    {
        startPage();
        List<HzjyAdvertising> list = hzjyAdvertisingService.selectHzjyAdvertisingList(hzjyAdvertising);
        return getDataTable(list);
    }

    /**
     * 导出广告位列表
     */
    /*@PreAuthorize("@ss.hasPermi('system:advertising:export')")
    @Log(title = "广告位", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(HzjyAdvertising hzjyAdvertising)
    {
        List<HzjyAdvertising> list = hzjyAdvertisingService.selectHzjyAdvertisingList(hzjyAdvertising);
        ExcelUtil<HzjyAdvertising> util = new ExcelUtil<HzjyAdvertising>(HzjyAdvertising.class);
        return util.exportExcel(list, "advertising");
    }*/

    /**
     * 获取广告位详细信息
     */
    @GetMapping(value = "/selectOne")
    public AjaxResult getInfo(Long id)
    {
        return AjaxResult.success(hzjyAdvertisingService.selectHzjyAdvertisingById(id));
    }
}
